<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>网站后台管理系统</title>
<meta name="keywords" content="">
<meta name="description" content="">
<!--[if lte IE 6]>
<link rel="stylesheet" type="text/css" href="css/ie6.css"/>
<![endif]-->
<link rel="stylesheet" type="text/css"  href="../../../../public/layui/css/layui.css">
<link href="../../../../public/admin/css/style_v2.0.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/layui/css/layui.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/css/style_v2.0.css" />
<script type="text/javascript" src="__PUBLIC__/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/layui/layui.js"></script>
</head>
<body>
<div class="position mt10">当前位置：<a href="/admin.php/">后台首页</a> > 域名列表</div>
<div id="container">
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
  <legend>域名信息</legend>
</fieldset>
<div class="layui-form" >
   <div class="layui-btn-group">
     <a href="{:U('Admin/Web/domain/')}" class="layui-btn layui-btn-big"><i class="layui-icon">&#xe60a;</i> 全部域名</a>
     <a href="{:U('Admin/Web/search',array('sotype'=>'1'))}" class="layui-btn layui-btn-big layui-btn-danger"><i class="layui-icon">&#xe60e;</i> 急需续费域名</a>
    <a href="{:U('Admin/Web/search',array('sotype'=>'2'))}" class="layui-btn layui-btn-big  layui-btn-primary"><i class="layui-icon">&#x1006;</i> 已过期域名</a>
  </div>
   <div class="layui-btn-group" style="float:right;">
      <a href="{:U('Web/domain_add/')}"  class="layui-btn layui-btn-big"><i class="layui-icon">&#xe608;</i>  添加新域名</a>
      <a href="{:U('web/export/')}"  class="layui-btn layui-btn-big layui-btn-normal"><i class="layui-icon">&#xe629;</i> 导出报表</a>
</div>
<div class="hselect mt10" style="background-color:#FFFFFF;">
    <form name='search' action="{:U('Admin/Web/search')}" enctype="multipart/form-data" method="post"  class="layui-form">
    <span>高级搜索：</span>
    <div id="keyword"><input name="keyword" type="text" id="keyword"  value="" placeholder="请输入关键词" autocomplete="off" class="layui-input"></div>
    
    <div class="hselect_box" style="width:120px;">
     <select name="group" lay-verify="" lay-filter="">
          <option value="">选择所在分组</option>
          <volist name="group" id="g">
          <option value="{$g.gid}">{$g.groupname}</option>
          </volist>
        </select>
    </div>
    <div class="hselect_box" style="width:120px;">
     <select name="account" lay-verify="">
           <option value="">域名所属账号</option>
           <volist name="account" id="a">
           <option value="{$a.aid}">{$a.aname}</option>
           </volist>
        </select>
    </div>
    <span>到期时间:</span>
    <div class="hselect_box" style="width:120px;">
         <input name="dstart" type="text" value=""  placeholder="开始日" onClick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD'})" class="layui-input ico-date" id="LAY_demorange_s">
    </div>
    <span style="padding-right:10px">-</span>
    <div class="hselect_box" style="width:120px;">
    <input name="dend" type="text"  value=""  placeholder="结束日" onClick="layui.laydate({elem: this, istime: true, format: 'YYYY-MM-DD'})" class="layui-input ico-date" id="LAY_demorange_e">
    </div>
    <div class="hselect_box"><button class="layui-btn layui-btn-primary" style=" margin-top:-4px;" lay-submit lay-filter="formSearch">立即提交</button></div>
    </form>
    <div class="c"></div>
</div>
</div>
<!--高级搜索-->
<div class="c"></div>
<div class="layui-form" >
<table class="layui-table" id="table">
    <thead>
    <tr style="text-align:center;">
      <th tyle="text-align:center;">&nbsp;</th>
      <th>域名</th>
      <th>网站名称</th>
      <th>分组</th>
      <th>状态</th>
      <th>是否启用</th>
      <th>到期时间</th>
      <th>域名到期时间</th>
      <th>服务器类型</th>
      <th>所属账号</th>
      <th>联系人</th>
      <th colspan="2" align="center">操作</th>
    </tr> 
    </thead>
    <form id="form2" name="form2" method="post" action="{:U('Admin/Web/domain_del/')}">  
     <volist name="list" id="r">
    <tr>
      <td  align="center" class="layui-form-item"><input type="checkbox" title="{$r.did}" id="did[]"  lay-skin="primary"  name="did[]" value="{$r.did}" /></td>
      <td align="center" height="22px">{$r.weburl}</td>
      <td align="center" height="22px">{$r.webname}</td>
      <td align="center" height="22px">{$r.gid}</td>
      <td >{$r.status}</td>
      <td >{$r.work}</td>
      <td >{$r.endtime|date="Y-m-d",###}</td>
      <td >{$r.dend|date="Y-m-d",###}</td>
      <td >{$r.hosttype}</td>
      <td >{$r.webaccount}</td>
      <td >{$r.linkman}</td>
      <td  align="center">
         <div class="layui-btn-group">
          <a href="{:U('Admin/Web/webfast_update/',array('did' => $r['did']))}" title="续费更新" class="layui-btn layui-btn-small"><i class="layui-icon">&#x1002;</i></a><a href="{:U('Admin/Web/domain_edit/',array('did' => $r['did']))}" title="编辑" class="layui-btn layui-btn-small"><i class="layui-icon">&#xe642;</i></a><a href="{:U('Admin/Web/domain_del',array('did' => $r['did']))}" class="layui-btn layui-btn-small layui-btn-danger" title="删除" onClick="return checkConfirm('您确认删除记录?')"><i class="layui-icon">&#xe640;</i></a>
          </div>
      </td>
    </tr>
    </volist>
    <tr>
      <td align="center"><input type="checkbox" name="" lay-skin="primary" lay-filter="allChoose"></td>
      <td colspan="10">
      <div style="padding-left:20px;">  
         <input type="button" value="全选" name="selectall" class="layui-btn" />
         <input type="button" value="反选" name="selectno" class="layui-btn "/>
         <button  name="btnDel" lay-submit="" lay-filter="btnDel" class="layui-btn layui-btn-danger" />删除</button>
      </div>      </td>
      <td align="center">&nbsp;</td>
    </tr>
   </form>
    </table>
    </div>
    <div class="c"></div>
    <div id="pages">{$page}</div>      

</div>
</body>
</html>
<script>
//Demo
layui.use(['form','laydate'], function(){
  var form = layui.form();
  var laydate = layui.laydate;
   //,layer = layui.layer
   
   var start = {
    min: '1900-01-01 00:00:00'
    ,max: '2099-06-16 23:59:59'
    ,istoday: false
    ,choose: function(datas){
      end.min = datas; //开始日选好后，重置结束日的最小日期
      end.start = datas //将结束日的初始值设定为开始日
    }
  };
  
  var end = {
    min: '1900-01-01 00:00:00'
    ,max: '2099-06-16 23:59:59'
    ,istoday: false
    ,choose: function(datas){
      start.max = datas; //结束日选好后，重置开始日的最大日期
    }
  };
  
  document.getElementById('LAY_demorange_s').onclick = function(){
    start.elem = this;
    laydate(start);
  }
  document.getElementById('LAY_demorange_e').onclick = function(){
    end.elem = this
    laydate(end);
  }
   
   form.verify({
        price_min: [/\d*$/, '必须是数字']
	   ,price_max: function(value){
	       if(value != ""){
			   if(!new RegExp(/^\d*$/).test(value)){
		            return '必须是数字0';
		       }
			   if(value < $("#price_min").val()){
			       return '价格范围填写错误';
			   }
		   }else{
		      //layer.msg(value));
		   }
	   }
   });
   
   /*全选*/
   $("input[name=selectall]").click(function(){
       var child = $("#table").find('td input[type="checkbox"]');
	   child.each(function(index, item){
           item.checked = true;
       });
       form.render('checkbox');
   });
   
   /*反选*/
   $("input[name=selectno]").click(function(){
       var child = $("#table").find('td input[type="checkbox"]');
	   child.each(function(index, item){
		   console.log(item.checked);
		   item.checked = !item.checked;
       });
       form.render('checkbox');
   });
	
   //复选框全选
   form.on('checkbox(allChoose)', function(data){
      var child = $(data.elem).parents('table').find('tbody input[type="checkbox"]');
      child.each(function(index, item){
        item.checked = data.elem.checked;
      });
     form.render('checkbox');
   });
   
  //监听提交
  form.on('submit(formSearch)', function(data){
    //layer.msg(JSON.stringify(data.field));
	title: '最终的提交信息'
	return true;
  });

});
</script>